namespace devtm.Emit
{
    using System;
    

    [Serializable]
    public class ConditionStatement : Statement
    {
        private Expression condition;
        private StatementCollection falseStatments;
        private StatementCollection trueStatments;

        public ConditionStatement()
        {
            this.trueStatments = new StatementCollection();
            this.falseStatments = new StatementCollection();
        }

        public ConditionStatement(Expression condition, params Statement[] trueStatements)
        {
            this.trueStatments = new StatementCollection();
            this.falseStatments = new StatementCollection();
            this.Condition = condition;
            this.TrueStatements.AddRange(trueStatements);
        }

        public ConditionStatement(Expression condition, Statement[] trueStatements, Statement[] falseStatements)
        {
            this.trueStatments = new StatementCollection();
            this.falseStatments = new StatementCollection();
            this.Condition = condition;
            this.TrueStatements.AddRange(trueStatements);
            this.FalseStatements.AddRange(falseStatements);
        }

        public Expression Condition
        {
            get
            {
                return this.condition;
            }
            set
            {
                this.condition = value;
            }
        }

        public StatementCollection FalseStatements
        {
            get
            {
                return this.falseStatments;
            }
        }

        public StatementCollection TrueStatements
        {
            get
            {
                return this.trueStatments;
            }
        }

        public override object Visit(Object parent, object builder)
        {
            throw new NotImplementedException();
        }
    }
}
